<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="chen.valuebean.GoodsSingle" %>
<%@ page import="chen.valuebean.Goods" %>

<jsp:useBean id="goods" scope="application" class="chen.valuebean.Goods" />
<% //获取goods实例中用来存储所有商品的列表
    ArrayList goodslist=goods.getGoodslist(); %>
<table border="0" width="650" rules="none" cellspacing="0" cellpadding="0" >
<tr>
<td>
   <table border="0" width="550" rules="none" cellspacing="0" cellpadding="0">
	<tr><td  height="80" colspan="3"  width="550" align="left"><p  style="font-size:80pt; color: fuchsia">今日推荐</p>
        </td></tr>
	<tr align="center" height="30" bgcolor="lightgrey">
	   <td></td>
           <td>名称</td>
	   <td>价格(元/斤)</td>
	   <td>购买</td>
	</tr>
	<%  if(goodslist==null||goodslist.size()==0){ %>
	<tr height="100"><td colspan="3" align="center">没有商品可显示！</td></tr>
	<% 
		} 
		else{
		  for(int i=0;i<goodslist.size();i++){
		  GoodsSingle single=(GoodsSingle)goodslist.get(i);
	%>
	<tr height="50" align="center">
        <td><img src=img/<%=single.getImg()%> height="150"  width="300" hspace="20" vspace="10"></td>
		<td><%=single.getName()%></td>
		<td><%=single.getPrice()%></td>
        <td><a href="Docar?action=buy&id=<%=i%>">购买</a></td>
	</tr>
	<%
		  }
	   }
	%>
     <tr height="50">
      <td align="center" colspan="3"><a href="shopcar.jsp">查看购物车</a></td>
     </tr>
     </table>
  </td>
  <td><%@ include file="littleShopcar.jsp"%></td>
</tr>
</table>